# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=smbmap
pkgver=v1.10.7.r9.g93c34ae
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-recon')
pkgdesc='A handy SMB enumeration tool.'
arch=('any')
url='https://github.com/ShawnDEvans/smbmap'
license=('GPL3')
depends=('python' 'impacket' 'python-pyasn1' 'python-pycryptodomex'
         'python-configupdater' 'python-termcolor')
makedepends=('python-build' 'python-pip' 'git')
source=("git+https://github.com/ShawnDEvans/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd $pkgname

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $pkgname
}

